From fd5453a7bea4bbc5258b7f984d9f0e6317f0ebc6 Mon Sep 17 00:00:00 2001 From: "kaf24@scramble.cl.cam.ac.uk" Date: Fri, 21 Jan 2005 19:02:35 +0000 Subject: [PATCH] bitkeeper revision 1.1159.224.6 (41f151cby-4agnF_MdJ_L_DQDJjYbw) another manual merge. --- xen/arch/x86/domain.c | 18 ++++++++++++++++++ xen/arch/x86/memory.c | 6 +++--- xen/common/domain.c | 2 +- xen/common/schedule.c | 18 +++++++----------- xen/include/xen/domain.h | 6 +++++- 5 files changed, 34 insertions(+), 16 deletions(-) diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c index 31273080e0..2ef7358433 100644 --- a/xen/arch/x86/domain.c +++ b/xen/arch/x86/domain.c @@ -226,6 +226,8 @@ void dump_pageframe_info(struct domain *d) } xmem_cache_t *domain_struct_cachep; +xmem_cache_t *exec_domain_struct_cachep; + void __init domain_startofday(void) { domain_struct_cachep = xmem_cache_create( @@ -233,6 +235,12 @@ void __init domain_startofday(void) 0, SLAB_HWCACHE_ALIGN, NULL, NULL); if ( domain_struct_cachep == NULL ) panic("No slab cache for domain structs."); + + exec_domain_struct_cachep = xmem_cache_create( + "exec_dom_cache", sizeof(struct exec_domain), + 0, SLAB_HWCACHE_ALIGN, NULL, NULL); + if ( exec_domain_struct_cachep == NULL ) + BUG(); } struct domain *arch_alloc_domain_struct(void) @@ -245,6 +253,16 @@ void arch_free_domain_struct(struct domain *d) xmem_cache_free(domain_struct_cachep, d); } +struct exec_domain *arch_alloc_exec_domain_struct(void) +{ + return xmem_cache_alloc(exec_domain_struct_cachep); +} + +void arch_free_exec_domain_struct(struct exec_domain *ed) +{ + xmem_cache_free(exec_domain_struct_cachep, ed); +} + void free_perdomain_pt(struct domain *d) { free_xenheap_page((unsigned long)d->mm_perdomain_pt); diff --git a/xen/arch/x86/memory.c b/xen/arch/x86/memory.c index f1b22bee00..739dda8ef2 100644 --- a/xen/arch/x86/memory.c +++ b/xen/arch/x86/memory.c @@ -961,7 +961,7 @@ int new_guest_cr3(unsigned long pfn) } else { - MEM_LOG("Error while installing new baseptr %08lx", ptr); + MEM_LOG("Error while installing new baseptr %08lx", pfn); } return okay; @@ -1341,7 +1341,7 @@ int do_mmu_update( LOCK_BIGLOCK(d); - cleanup_writable_pagetable(d, PTWR_CLEANUP_ACTIVE | PTWR_CLEANUP_INACTIVE); + cleanup_writable_pagetable(d); /* * If we are resuming after preemption, read how much work we have already @@ -1572,7 +1572,7 @@ int do_update_va_mapping(unsigned long page_nr, LOCK_BIGLOCK(d); - cleanup_writable_pagetable(d, PTWR_CLEANUP_ACTIVE | PTWR_CLEANUP_INACTIVE); + cleanup_writable_pagetable(d); /* * XXX When we make this support 4MB superpages we should also deal with diff --git a/xen/common/domain.c b/xen/common/domain.c index 5366800f29..70f8d0060f 100644 --- a/xen/common/domain.c +++ b/xen/common/domain.c @@ -354,7 +354,7 @@ long do_boot_vcpu(unsigned long vcpu, full_execution_context_t *ctxt) out: if ( c != NULL ) xfree(c); - xmem_cache_free(exec_domain_struct_cachep, d->exec_domain[vcpu]); + arch_free_exec_domain_struct(d->exec_domain[vcpu]); d->exec_domain[vcpu] = NULL; return rc; } diff --git a/xen/common/schedule.c b/xen/common/schedule.c index 35ae9468a1..21a1ae25ac 100644 --- a/xen/common/schedule.c +++ b/xen/common/schedule.c @@ -89,17 +89,14 @@ static struct scheduler ops; /* Per-CPU periodic timer sends an event to the currently-executing domain. */ static struct ac_timer t_timer[NR_CPUS]; -extern xmem_cache_t *domain_struct_cachep; -extern xmem_cache_t *exec_domain_struct_cachep; - void free_domain_struct(struct domain *d) { struct exec_domain *ed; SCHED_OP(free_task, d); for_each_exec_domain(d, ed) - xmem_cache_free(exec_domain_struct_cachep, ed); - xmem_cache_free(domain_struct_cachep, d); + arch_free_exec_domain_struct(ed); + arch_free_domain_struct(d); } struct exec_domain *alloc_exec_domain_struct(struct domain *d, @@ -109,7 +106,7 @@ struct exec_domain *alloc_exec_domain_struct(struct domain *d, ASSERT( d->exec_domain[vcpu] == NULL ); - if ( (ed = xmem_cache_alloc(exec_domain_struct_cachep)) == NULL ) + if ( (ed = arch_alloc_exec_domain_struct()) == NULL ) return NULL; memset(ed, 0, sizeof(*ed)); @@ -143,7 +140,7 @@ struct exec_domain *alloc_exec_domain_struct(struct domain *d, out: d->exec_domain[vcpu] = NULL; - xmem_cache_free(exec_domain_struct_cachep, ed); + arch_free_exec_domain_struct(ed); return NULL; } @@ -152,7 +149,7 @@ struct domain *alloc_domain_struct(void) { struct domain *d; - if ( (d = xmem_cache_alloc(domain_struct_cachep)) == NULL ) + if ( (d = arch_alloc_domain_struct()) == NULL ) return NULL; memset(d, 0, sizeof(*d)); @@ -163,7 +160,7 @@ struct domain *alloc_domain_struct(void) return d; out: - xmem_cache_free(domain_struct_cachep, d); + arch_free_domain_struct(d); return NULL; } @@ -379,8 +376,7 @@ void __enter_scheduler(void) if ( !is_idle_task(current->domain) ) { LOCK_BIGLOCK(current->domain); - cleanup_writable_pagetable( - prev->domain, PTWR_CLEANUP_ACTIVE | PTWR_CLEANUP_INACTIVE); + cleanup_writable_pagetable(prev->domain); UNLOCK_BIGLOCK(current->domain); } diff --git a/xen/include/xen/domain.h b/xen/include/xen/domain.h index 4fd86f51f8..c2d0dbc144 100644 --- a/xen/include/xen/domain.h +++ b/xen/include/xen/domain.h @@ -12,7 +12,11 @@ extern struct domain *arch_alloc_domain_struct(void); extern void arch_free_domain_struct(struct domain *d); -extern void arch_do_createdomain(struct domain *d); +struct exec_domain *arch_alloc_exec_domain_struct(void); + +extern void arch_free_exec_domain_struct(struct exec_domain *ed); + +extern void arch_do_createdomain(struct exec_domain *ed); extern int arch_final_setup_guestos( struct exec_domain *d, full_execution_context_t *c); -- 2.30.2